[release/8.0] wasm-tools: Fix workload manifest MSI ProductVersion generation #91023
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Backport of #91015 to release/8.0
/cc @joeloff
Customer Impact
Manifest installers for .NET optional workloads rely on performing major upgrades in .NET 6 and 7. This requires that the MSI version increments for new builds. The MSI version was generated using the assembly version. MSI versions should be generated using the major/minor/patch/buildnumber, e.g. 7.0.11.12345. Because the assembly version was being used, the patch value was always set to 0. Due to the bit masking and shift operations used to construct the MSI version, the 3rd part of the version number wrapped around, generating a smaller version for a newer release. MSI ProductVersion is only 32-bits in size (8-bit major, 8-bit minor and 16-bit build number).
While 8.0 is using SxS manifests, having MSIs with lower version can result in manifest validation errors when inserting to VS. It will also be confusing to ship MSIs with lower version in newer releases. If we ever decide to flip back to upgradable manifest installers, the versioning issues will block the CLI from correctly installing updates.
Testing
Verification has to be manual using Orca to inspect the MSI product version along with the component manifest for the generated workload that flows to VS.
Risk
Low, the fix has been validated for .NET 6 and 7 as part of the September servicing release.